package com.sskj.mine.presenter;

import com.lzy.okgo.OkGo;
import com.lzy.okgo.model.Response;
import com.sskj.common.base.HttpData;
import com.sskj.lib.http.JsonCallBack;
import com.sskj.mine.http.HttpConfig;
import com.sskj.mine.ui.fragment.MineFragment;


/**
 * @author Hey
 * Create at  2019/05/01
 */
public class MineFragmentPresenter extends BasePresenter<MineFragment> {



    public void getContract() {
        OkGo.<HttpData<String>>get(HttpConfig.BASE_URL + HttpConfig.CONTRACT)
                .execute(new JsonCallBack<HttpData<String>>(this) {
                    @Override
                    public void onSuccess(Response<HttpData<String>> response) {
                        HttpData<String> body = response.body();
                        if (body.getStatus() == HttpConfig.OK) {
                            mView.showEmail(body.getData());
                        }
                    }
                });
    }
}
